
import java.util.Calendar;
import java.util.GregorianCalendar;
import javax.swing.JOptionPane;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author desjava
 */
public class Teste {
    
    
    public static void main(String args[]) throws Exception{
        
       Teste t = new Teste();
       
    System.out.println( t.validaHora("44:44"));
     
        
        
        
    }
    
    public boolean validaHora(String horatxt) {
        boolean erro = false;
        
        System.out.println(horatxt);

        Integer hora = Integer.parseInt(horatxt.substring(0, 2));
        Integer min = Integer.parseInt(horatxt.substring(3));
        
   //     System.out.println(
 //             "str"+ horatxt.substring(2)
      //          );
        
        System.out.println(hora);
        System.out.println(min);

        if ( hora > 24 ) {
            erro = true;
        } else if ( min > 60 ) {
            erro = true;
        }
        
        return erro;
    }
    
    
       private boolean isFinalDeSemana(int ano, int mes, int dia) throws Exception {
        if ((mes < 1) || (mes > 12)) {
            throw new Exception("Mês inválido");
        }

        boolean finalDeSemana;
        mes = mes - 1;
        Calendar data = new GregorianCalendar();

        data.set(ano, mes, 1);
        int diaMaximo = data.getActualMaximum(Calendar.DAY_OF_MONTH);

        if (diaMaximo < dia) {
            throw new Exception("Dia inválido");
        }

        data.set(ano, mes, dia);
        int diaDaSemana = data.get(Calendar.DAY_OF_WEEK);

        if ((diaDaSemana == Calendar.SATURDAY) || (diaDaSemana == Calendar.SUNDAY)) {
            finalDeSemana = true;
        } else {
            finalDeSemana = false;
        }

        return finalDeSemana;
    }
    
    
}
